<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />		
		<meta charset="UTF-8">
		<title>理疗时间安排表</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/header.css"/>	
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/timePlan.css" />
	</head>
	<body>
		<div class="header">
			<a href="/index"><span class="back"></span></a>
			<a href="/index"><span class="logo_pic"></span></a>
			<span class="logo_text">OK 妈咪</span>
		</div>
		<div class="header-main">
			<div class="header-top">
				<h3 class="hearder-title">${user.name }的课程计划表</h3>	
			</div>
			<p>顾客姓名<span>${user.name }</span></p>
			<p>联系电话<span>${user.phone }</span></p>
			<div class="header-content">
				<h4>方案内容</h4>
				<div class="header-content-deatil">
					<c:forEach items="${list }" var="list">
					<span>${list.name }-${list.numbers }</span>
					</c:forEach>
				</div>				
			</div>
		</div>
	<div id="courseList"></div>
	
	<div class="tip">
		<h3>注意事项</h3>
		<p>因有些项目之间可以重叠做,所以实际理疗总时长会比标识时间段</p>
	</div>
<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/lib/layer/layer.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/app/js/kit.js"></script>
<script type="text/javascript" src="${BASE_PATH}/static/lib/template/template.js"></script>
<script type="text/javascript">
var totalPage = 1,loading = false,pageNum=0;
$(function(){
	//绑定“加载中”进入加载事件
	Kit.util.onPageEnd(function(){
          	if(pageNum < totalPage && !loading){
          		loading = true;
          		$("#courseList").append("<div class=\"app-loading\">正在加载</div>");
          		Kit.ajax.post("${BASE_PATH}/my/myInfo/coursePage",{pageNum:pageNum+1,pageSize:2,userid:'${user.id}'},function(result){
				$("#courseList").append(template("dataTpl",result.object));
				pageNum = result.object.pageNumber;
				totalPage = result.object.totalPage;
				$(".app-loading","#courseList").remove();
				/* //没找到数据
				if(totalPage==0) {
					$("#courseList").append('<label>暂时没有理疗安排 </label>');
				} */
				loading = false;
			});
          }
	});
})
</script>
<script type="text/html" id="dataTpl">
{{each list as course index}}
	<div class="warp">
		<h3>{{course.date}} <span>{{course.week}}</span></h3>
		{{if course.course1!=null}}
		<p>课程名称<span>{{course.course1}}</span></p>
		{{/if}}
		{{if course.course2!=null}}
		<p>课程名称<span>{{course.course2}}</span></p>
		{{/if}}
		{{if course.course3!=null}}
		<p>课程名称<span>{{course.course3}}</span></p>
		{{/if}}
		{{if course.course4!=null}}
		<p>课程名称<span>{{course.course4}}</span></p>
		{{/if}}
		<p>总时长
		<span>
		{{if course.course1_time!=0}}{{course.course1_time}}{{/if}}
		{{if course.course2_time!=0}}+{{course.course2_time}}{{/if}}
		{{if course.course3_time!=0}}+{{course.course3_time}}{{/if}}
		{{if course.course4_time!=0}}+{{course.course4_time}}{{/if}} 分钟</span></p>
	</div>			
{{/each}}

</script>
</body>
</html>